package com.glory.wxelectricitypda.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.wxelectricitypda.R;
import com.glory.wxelectricitypda.bean.QcCheckBean;

import java.util.List;


public class QcCheckListAdapter extends BaseQuickAdapter<QcCheckBean, BaseViewHolder> {

    public QcCheckListAdapter(@Nullable List<QcCheckBean> data) {
        super(R.layout.adapter_qc_check, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, final QcCheckBean item) {
        helper.setText(R.id.tvWaiNum, item.getATTRIBUTE2());
        helper.setText(R.id.tvWaiLot, item.getATTRIBUTE1());
        helper.setText(R.id.tvLotId, item.getLOTID());
        helper.setText(R.id.tvNum, item.getMAINQTY());
        if (item.getOPERATOR2().isEmpty()){
            helper.getView(R.id.llMain).setBackgroundColor(mContext.getResources().getColor(R.color.free_ui_white));
        }else {
            helper.getView(R.id.llMain).setBackgroundColor(mContext.getResources().getColor(R.color.free_ui_select_gray));
        }
    }
}
